{template Public:Admin:header}
<style type="text/css">
input[type="checkbox"], input[type="radio"] {
	opacity: 1;
	position: static;
}
</style>
<br />
<div class="row"> 
<div class="col-lg-11 col-lg-offset-1"> 

<form action="/admin/task/edit/id/{echo $id}" method="post" class="form-horizontal bv-form" id="TaskForm" novalidate="novalidate" data-bv-feedbackicons-validating="glyphicon glyphicon-refresh" data-bv-feedbackicons-invalid="glyphicon glyphicon-remove" data-bv-feedbackicons-valid="glyphicon glyphicon-ok">

<input type="hidden" name="datatype" value="json"/>
<input type="hidden" name="Submit" value="true"/>
<input type="hidden" name="catid" id="Catid" value="{if !empty($manage['catid'])}{echo $manage['catid']}{/if}"/>
<input type="hidden" name="id" value="{echo $id}"/>
           
 <div class="row"><h4>任务ID: {echo $id}</h4>  </div>
        
{template Task:Publish:form}
 
 <div class="row">
 {template Task:Publish:setmoneyform}
 </div>
		<div class="row">
               <div class="col-lg-12">
               	<div class="row"><button class="btn btn-success" type="submit" onclick="return  TaskForm();">发 布</button></div>
               </div>
            </div>



</div>
</div>

</form>

<!--Bootstrap Date Picker-->
<script src="{echo AURL}/js/datetime/bootstrap-datepicker-{echo C('DEFAULT_LANG')}.js"></script>
<script>
function TaskForm(){
	 $.post('/admin/task/edit/id/{echo $id}',$("#TaskForm").serialize(), function(json) {
					
			$('.bootbox').PhpappProgress({json:json});

			return true;
		
	  }, 'json');
	  

	 bootbox.dialog({
		 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
		 title: '<i class="icon fa fa-retweet"></i> 提交中',
		 closeButton: false
	 }).PhpappProgress({time:1000});
 
}
$(function(){
	
			 var um = UM.getEditor('Content');
			 
			 um.addListener("contentChange",function(){
				if(UM.getEditor('Content').hasContents()){
					$('#TaskForm button[type="submit"]').attr('disabled',false);
				}
			 });
			 
			  
			 $("#TaskCategory").click( function () { $('#TaskForm button[type="submit"]').attr('disabled',false); }); 
				
			//分类
		  SetFormCategory(AURL+"/js/foxphp_json_task_category.js",'#TaskCategory');
		  

/*
 		  $('#AdminTaskForm').bootstrapValidator({
                excluded: [':disabled'],
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
				fields: {
					subject: {
						validators: {
							notEmpty: {
								message: '任务标题不能为空！'
							},
							stringLength: {
								min: 5,
								max: 100,
								message: '标题最少5个字到100字内！'
							}
						}
					},
					phone: {
						validators: {
							notEmpty: {
								message: '联系电话不能为空！'
							},
							regexp: {
								regexp: /^[0-9]+$/,
								message: '联系电话格式有误！'
							}
						}
					}
					
				},
                submitHandler: function (form) {
					
						
					var catid=$("#Catid").val();
					if(catid<1){
						 bootbox.alert({ 
							size: 'small',
							message: "请选择任务分类！"
						})
						 return false; 
					 }
									 
				 if(!UM.getEditor('Content').hasContents()){
					 bootbox.alert({ 
						size: 'small',
						message: "请填写任务需求！"
					 })
					 return false; 
				 }
									 
				 validator.defaultSubmit();
				  
			 
				  return false; 
				 
                } 
			
            }) 
		*/	
			
			$(".form-control-feedback").remove();

});

</script>
    			
{template Public:Admin:footer}